package com.dsbj.icardservice.utils.strprocess;

/**
 * @author cjw 2019-10-21
 */
public class RandomStrUtil {
	
	/**
	 * 返回《0, range-1》范围内的整数。
	 *
	 * @return
	 */
	public static int getNum(int range) {
		
		int result = 0;
		result = (int) (Math.random() * range);
		return result;
	}
	
	/**
	 * 随机返回count位数字，数字范围为：0-9。
	 *
	 * @return
	 */
	public static String getNumStr(int count) {
		String chars = "0123456789";
		String result = "";
		
		for (int i = 0; i < count; i++) {
			result = result + chars.charAt(getNum(10));
		}
		return result;
	}
	
	
}
